<?php
// $Id$: training.module

/**
 * @file
 * race = Regatta Training
 */

/*
Translation

empty
occupied
locked

sperren
entsperren
belegen
freigeben
*/

require_once 'race'. DIRECTORY_SEPARATOR. 'ui' .     DIRECTORY_SEPARATOR. 'form.php';
require_once 'race'. DIRECTORY_SEPARATOR. 'ui' .     DIRECTORY_SEPARATOR. 'user.php';
require_once 'race'. DIRECTORY_SEPARATOR. 'ui' .     DIRECTORY_SEPARATOR. 'admin.php';
require_once 'race'. DIRECTORY_SEPARATOR. 'facade' . DIRECTORY_SEPARATOR. 'action.php';
require_once 'race'. DIRECTORY_SEPARATOR. 'service' .DIRECTORY_SEPARATOR. 'signup.php';
require_once 'race'. DIRECTORY_SEPARATOR. 'service' .DIRECTORY_SEPARATOR. 'config.php';
require_once 'race'. DIRECTORY_SEPARATOR. 'service' .DIRECTORY_SEPARATOR. 'assignment.php';
require_once 'race'. DIRECTORY_SEPARATOR. 'dao' .    DIRECTORY_SEPARATOR. 'dao.php';
require_once 'race'. DIRECTORY_SEPARATOR. 'util' .   DIRECTORY_SEPARATOR. 'util.php';

require_once 'data'. DIRECTORY_SEPARATOR .'defaults.php';
require_once 'data'. DIRECTORY_SEPARATOR .'constants.php';

/**
 * Implementation of hook_menu().
 */
function race_menu() {
  
 $items['race/signoff/%'] = array(
    'title' => t('Sign off'),
    'page callback' => 'race_signoff',
    'page arguments' => array(2),
    'access arguments' => array('sign up'),
    'type' => MENU_CALLBACK,
  );
  
  $items['race/signup_boat/%/%'] = array(
    'title' => t('Sign off'),
    'page callback' => 'race_signup_for_boat',
    'page arguments' => array(2, 3),
    'access arguments' => array('sign up'),
    'type' => MENU_CALLBACK,
  );
  
    $items['race/signoff_boat/%/%'] = array(
    'title' => t('Sign off'),
    'page callback' => 'race_signoff_from_boat',
    'page arguments' => array(2, 3),
    'access arguments' => array('sign up'),
    'type' => MENU_CALLBACK,
  );

  $items['race/automatic_assign/%'] = array(
    'title' => t('Automatic assign'),
    'page callback' => 'race_automatic_assign',
    'page arguments' => array(2),
    'access arguments' => array('admin'),
    'type' => MENU_CALLBACK,
  );
  
  $items['race/assign/%/%/%'] = array(
    'title' => t('Assign'),
    'page callback' => 'race_assign',
    'page arguments' => array(2, 3, 4),
    'access arguments' => array('admin'),
    'type' => MENU_CALLBACK,
  );
  
  $items['race/unassign/%/%/%'] = array(
    'title' => t('Unassign'),
    'page callback' => 'race_unassign',
    'page arguments' => array(2, 3, 4),
    'access arguments' => array('admin'),
    'type' => MENU_CALLBACK,
  );
  
  $items['race/reject/%/%'] = array(
    'title' => t('Reject'),
    'page callback' => 'race_reject',
    'page arguments' => array(2, 3),
    'access arguments' => array('admin'),
    'type' => MENU_CALLBACK,
  );
  
  $items['race/change_mode/%'] = array(
    'title' => t('Change mode'),
    'page callback' => 'race_change_mode',
    'page arguments' => array(2),
    'access arguments' => array('admin'),
    'type' => MENU_CALLBACK,
  );

  $items['race/reset/%'] = array(
    'title' => t('Reset'),
    'page callback' => 'race_reset',
    'page arguments' => array(2),
    'access arguments' => array('admin'),
    'type' => MENU_CALLBACK,
  );
  
  $items['race/%/overview'] = array(
    'title' => t('Overview'),
    'page callback' => 'race_overview',
    'page arguments' => array(1),
    'access arguments' => array('admin'),
    'access callback'   => TRUE,
    'type' => MENU_CALLBACK
  );
 
  $items['race/%/mail'] = array(
    'title' => t('Mail'),
    'page callback' => 'race_mail',
    'page arguments' => array(1),
    'access arguments' => array('admin'),
    'access callback'   => TRUE,
    'type' => MENU_CALLBACK
  );

  $items['race/%/admin'] = array(
    'title' => t('Admin'),
    'page callback' => 'race_admin',
    'page arguments' => array(1),
    'access arguments' => array('admin'),
    'access callback'   => TRUE,
    'type' => MENU_LOCAL_TASK
  );
  
  return $items;
}

/**
 * Implementation of hook_node_info
 */
function race_node_info() {
  return array(
    'race' => array(
      'name' => t('race'),
      'module' => 'race',
      'description' => t("Sign up and assign for races."),
    )
  );
} 

/**
 * Implementation of hook_perm().
 */
function race_perm() {
  return array('access content', 'sign up', 'admin');
}




